<?php

	
	
	//$DECKROOT = getcwd(); 

	//echo "testDeck DECKROOT:" . $DECKROOT . "<br />";

	//require $DECKROOT . '/config/config.php';
	//require $DECKROOT . '/classes/deck.php';
	
	require('./config/config.php');
	require('./classes/deck.php');


	
	$Decklist = new pmtDecklist($dbHost,$dbUser,$dbPass,$dbName);
	
	//$source = new DOMDocument();
	//$source = $Decklist->; 

	
	//echo $Decklist->xmlOutput();
	/*

	
	$docXML = new DOMDocument();
	$docXML->loadXML($source);
	
	$xslt = new xsltProcessor;
	$xslt->importStyleSheet($docXSL);
	$xslt->transformToXML($docXML);
	*/
	//echo $Decklist->xmlOutput();

	$xmlValue = $Decklist;
	/*
	$xmlValue = '<?xml version="1.0" encoding="UTF-8"?><decks><deck><id>1</id><name>testdeck1</name><description>This is the long description of the first testdeck in our test suite. This description can get pretty long hence the description long description of this description</description><shortdescription>Testdeck1 short description</shortdescription><status>1</status><themeid>0</themeid></deck><deck><id>2</id><name>testdeck2</name><description>This is the long description of the second testdeck in our test suite. This description can get pretty long hence the description long description of this description</description><shortdescription>Testdeck2 short description</shortdescription><status>1</status><themeid>0</themeid></deck><deck><id>3</id><name>testdeck3</name><description>This is the long description of the third testdeck in our test suite. This description can get pretty long hence the description long description of this description</description><shortdescription>Testdeck3 short description</shortdescription><status>1</status><themeid>0</themeid></deck></decks>';
	*/
	# LOAD XML FILE
$XML = new DOMDocument();
//$deckXML = './xml/deck.xml';
//$XML->load($deckXML);
//$XML->load($xmlVast);
$XML->loadXML($xmlValue);
//echo $source;

# START XSLT
$xslt = new XSLTProcessor();

# IMPORT STYLESHEET 1
$deckXSL = './xsl/testDeck.xsl';
$XSL = new DOMDocument();
$XSL->load( $deckXSL );


$xslt->importStylesheet( $XSL );


#PRINT
print $xslt->transformToXML( $XML );


echo("HALLO!!!");















	
?>